package cn.edu.scau.cmi.luotiansheng.spring.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.edu.scau.cmi.luotiansheng.spring.domain.Student;

public class ApplicationContextUtil {
	
	static ApplicationContext applicationContext=null;
	
	public static ApplicationContext getApplicationContext() {
		if(applicationContext==null) {
			applicationContext= new ClassPathXmlApplicationContext("applicationContext.xml");
		}
		return applicationContext;
		
	}
	
	/*
	 * public static void main(String[] args) { ApplicationContext
	 * app=ApplicationContextUtil.getApplicationContext(); Student
	 * student=(Student)app.getBean("stu"); System.out.println(student); }
	 */

}
